﻿/// <reference path="jquery-1.7-vsdoc.js" />
/// <reference path="jquery.validate.unobtrusive.js" />

$(document).ready(function () {
    //AddClientSideEmailValidation();
});

function AddClientSideEmailValidation() {
    $.validator.addMethod("emailaddress", function (value) {
        var isValid = false;
        $.ajax({
            url: "/Account/ValidateEmail",
            data: { email: value },
            async: false,
            success: function (data) {
                isValid = data.success
            }
        });
        return isValid;
    }, "Invalid e-mail address.");
    $.validator.unobtrusive.adapters.addBool("emailaddress");
}